package com.cfg;

/**
 * @author <a href="15226116300@163.com">王廷俊</a>
 * @Description
 * @Date 2024-11-12
 */
public class EngineConfigurationImpl implements EngineConfiguration {
    
    protected ServiceFactory serviceFactory;
    
    protected static EngineConfigurationImpl engineConfiguration;
    
    public ServiceFactory getServiceFactory() {
        return this.serviceFactory;
    }
    
    protected DynamicProxyConfiguration classDyncService;
    
    public static synchronized EngineConfigurationImpl getInstance() {
        if (engineConfiguration == null) {
            engineConfiguration = new EngineConfigurationImpl();
            engineConfiguration.init();
        }
        
        return engineConfiguration;
    }
    
    @Override
    public void init() {
        if (this.serviceFactory == null) {
            this.serviceFactory = new ServiceFactory(this);
        }
        if (classDyncService == null) {
            classDyncService = DynamicProxyConfiguration.getInstance();
        }
    }
    
    public DynamicProxyConfiguration getDynamicProxyConfiguration() {
        return classDyncService;
    }
    
    
}
